4<template>
	<view class="content">
		<!-- <view class="uview-banner">
			<view class="postion">
				<u-navbar class="custom-navbar11" title="商城" :bgColor="navBgColor" :titleStyle="{ color: navColor }"
					fixed>
					<view slot="left"></view>
				</u-navbar>
			</view>
		</view> -->
		<scroll-view scroll-y="true" style="width: 100vw;height: 98vh;">
			<view class="contnqeraq">
				<view>
					<view scroll-y="true" class="footer-55" style="margin-bottom: 100rpx;padding: 0 ;">

						<view class="flex-align  flex-wrap" v-if="wrapperlist.length">
							<view v-for="(item, index) in wrapperlist" :key="index" @click="Redemption(item)"
								style="margin-left: 20rpx;width: 345rpx;background-color: #ffffff;border-radius: 10rpx;box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(8,26,26,0.3);border-radius: 12rpx;margin-bottom: 20rpx;">
								<view class="footer-44">
									<image class="footer-img" :src="item.cate_img" mode=""></image>
								</view>
								<view class="footer-name">
									{{item.name}}
								</view>

								<view class="footer-jifen">
									<view class="footer-jf">
										<text class="footer-jf1">当前在报课程 </text>
										<text class="footer-jf2"> {{item.pro_cnt}}</text>
									</view>
									<view class="footer-dh">
										查看课程
									</view>
								</view>
							</view>
							<!-- <view class="addcon" style="width: 100%;height: 120rpx;"></view> -->
						</view>
						<!-- <view class="flex-align  flex-wrap" v-if="syList.length">
							<view v-for="(item, index) in syList" :key="index" @click="onsy(item)"
								style="margin-left: 20rpx;width: 345rpx;background-color: #ffffff;border-radius: 10rpx;box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(8,26,26,0.3);border-radius: 12rpx;margin-bottom: 20rpx;">
								<view class="footer-44">
									<image class="footer-img" :src="item.cate_img" mode=""></image>
								</view>
								<view class="footer-name">
									{{item.name}}
								</view>
						
								<view class="footer-jifen">
									<view class="footer-jf">
									</view>
									<view class="footer-dh" >
										查看课程
									</view>
								</view>
							</view>
						</view> -->
						<!-- <view class="" v-else
							style="display: flex; justify-content: center; flex-direction: column;align-items: center;width: 100%;">
							<u-empty mode="order" :icon="icon6" text="暂无数据" />
						</view> -->
						<view class="" style="display: flex;width: 100%;justify-content: center;height: 200rpx;"
							v-if="su_yi_img != ''">
							<!-- <view class="" style="flex-direction: row; font-size: 26rpx; color: black; align-items: center; background-image: url('https://oss.szsportscenter.cn/img/location.png');background-size: 100% 100%;width: 710rpx;height: 144rpx;margin-left: 10rpx;display: flex;justify-content: center;">
								<view class="" style="background-image: url('https://oss.szsportscenter.cn/img/zhengfangxing.png');background-size: 100% 100%;width: 160rpx;height: 42rpx;margin-left: 150rpx;margin-top: 40rpx;text-align: center;">
									<view style="color: #549B76;font-size: 22rpx;line-height: 40rpx;font-weight: 500;">立即进入</view>
								</view>
							</view> -->
							<image @click="onstore" style="width: 710rpx;height: 200rpx;margin-top: 20rpx;"
								:src="su_yi_img" v-if="location == 1" mode=""></image>
							<image style="width: 710rpx;height: 200rpx;margin-top: 20rpx;" :src="su_yi_img" v-else
								mode=""></image>
							<!-- <image :src="location" style="width: 710rpx;height: 144rpx;margin-left: 10rpx;"></image> -->
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
		<!-- 底部导航组件 -->
		<!-- <tabber :active="3"></tabber> -->
	</view>
</template>

<script>
	const personal = require('@/api/personal/index.js')
	const train = require("@/api/train/index.js");
	const index = require('@/api/personal/index.js')
	const market = require("@/api/market/index.js");
	export default {
		data() {
			return {
				icon6: this.$https.assetsPath + '58d1bf2665b8c20e302f02c56274f0ce972df8b4.png',
				jiantou: this.$https.assetsPath + "f264cc11bf384d70c190bbd13c52737e6e002957.png",
				icon2: 'https://oss.szsportscenter.cn/upload/4f/8af522d3c9d2241c9bace6dc33bb6f.png?attname=1%402x.png',
				location: this.$https.assetsPath + "location.png",
				mall: this.$https.assetsPath + 'shop_mall.png',
				navBgColor: 'rgba(255, 255, 255, 0)',
				navColor: '#000000',
				current_Tab: 0,
				looplist: [],
				onclickin: false,
				currentTab: 0,
				couponsList: [],
				listQuery: { //分页
					pageNo: 1,
					pageSize: 8,
				},
				totalPage: '', //几页
				wrapperlist: [],
				syList: [],
				total: "",
				resultlist: {},
				shop_id: '',
				su_yi_img: '',
				belong: 'train',
				menuActive: '',
				location: 0,
				venues_id: '',
				train_title: ''
			};
		},
		onLoad(options) {
			this.shop_id = options.id
			// this.belong = options.belong
			this.menuActive = options.menuActive
			this.venues_id = options.venues_id
		},

		onShow() {
			const that = this;
			that.trainCate()
		},

		methods: {
			onstore() {
				wx.navigateToMiniProgram({
					appId: 'wx8720bd306b1a4081',
					path: 'pages/course-list/course-list',
					extraData: {
						// 可选，传递给目标小程序的数据，具体格式自定义
					},
					envVersion: 'release', // 可选，跳转到目标小程序的版本，可选值为 develop（开发版）、trial（体验版）、release（正式版）
					success(res) {
						// 跳转成功的回调
					},
					fail(err) {
						// 跳转失败的回调
					}
				});
			},

			onsy(item) {
				if (item.link_type == 1) {
					wx.navigateToMiniProgram({
						appId: 'wx8720bd306b1a4081',
						path: 'pages/class-schedule/class-schedule',
						extraData: {
							// 可选，传递给目标小程序的数据，具体格式自定义
						},
						envVersion: 'release', // 可选，跳转到目标小程序的版本，可选值为 develop（开发版）、trial（体验版）、release（正式版）
						success(res) {
							// 跳转成功的回调
						},
						fail(err) {
							// 跳转失败的回调
						}
					});
				} else if (item.link_type == 2) {
					let link_url = item.link_url
					uni.navigateTo({
						url: `/page_points/webview/webview1?url=${link_url}`
					})
					// wx.navigateToMiniProgram({
					// 	appId: 'wx6f6831e5b83b7535',
					// 	path: '',
					// 	extraData: {
					// 		// 可选，传递给目标小程序的数据，具体格式自定义
					// 	},
					// 	envVersion: 'release', // 可选，跳转到目标小程序的版本，可选值为 develop（开发版）、trial（体验版）、release（正式版）
					// 	success(res) {
					// 		// 跳转成功的回调
					// 	},
					// 	fail(err) {
					// 		// 跳转失败的回调
					// 	}
					// });
				}
			},

			Redemption(item) {
				uni.navigateTo({
					url: "/page_venues/pages/venuesDetail/venuesDetail?shop_id=" + this.shop_id +
						'&belong=' + this.belong + '&menuActive=' + this.menuActive + '&venues_id=' + this
						.venues_id + '&cate_id=' + item.id + '&train_title=' + item.name,
				})
			},
			async trainCate() {
				let that = this;
				let postData = {
					shop_id: this.shop_id,
					project_id: getApp().globalData.projectId,
					app_id: this.$https.weixinAppId,
				}
				let res = await market.trainCate(postData);
				if (res.code == 1) {
					that.wrapperlist = res.data.cateList;
					that.syList = res.data.syList;
					that.su_yi_img = res.data.su_yi_img
					that.location = res.data.location
					that.train_title = res.data.train_title
					uni.setNavigationBarTitle({
						title: res.data.train_title
					});
				}
			},
		},
	};
</script>

<style lang="scss" scoped>
	@import url("@/static/css/index/index.css");
	@import url("@/static/css/personal/index.css");

	.content {
		width: 100%;
		height: auto;
		background-image: url('https://oss.szsportscenter.cn/img/baisebeij.png');
		display: flex;
		flex-direction: column;
		background-repeat: no-repeat;
		background-size: contain;
	}

	.contnqeraq {
		width: 100%;
		height: auto;
		border-radius: 30rpx;
		background-color: #fff;
		display: flex;
		flex-direction: column;
		position: relative;

		.footer-55 {
			// padding: 10rpx 10rpx 10rpx 10rpx;
			flex-wrap: wrap;
			display: flex;
			flex-direction: row;
			width: 100vw;
			height: auto;
			position: absolute;
			top: 10rpx;
			background-color: #fff;

			.footer-44 {
				width: 100%;
				height: 200rpx;
				border-radius: 12rpx;

				.footer-img {
					width: 345rpx;
					height: 200rpx;
					border-radius: 12rpx 12rpx 0 0;
				}
			}

			.footer-name {
				text-overflow: ellipsis;
				overflow: hidden;
				white-space: nowrap;
				line-height: 33rpx;
				margin-top: 20rpx;
				color: #333333;
				font-size: 28rpx;
				margin-left: 20rpx;
				height: 35rpx;
			}

			.footer-jifen {
				height: 40rpx;
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				align-items: center;
				font-size: 24rpx;
				margin-top: 10rpx;
				margin-bottom: 10rpx;
				color: #333333;

				.footer-jf {
					margin-left: 20rpx;

					.footer-jf1 {
						font-size: 24rpx;
						color: #000000;
					}

					.footer-jf2 {
						font-size: 24rpx;
						color: #ff0000;
					}
				}

				.footer-dh {
					width: 100rpx;
					height: 30rpx;
					background: linear-gradient(270deg, #47B37B 0%, #69D19B 100%), #4BA677;
					border-radius: 15rpx;
					color: #fff;
					font-size: 20rpx;
					text-align: center;
					line-height: 30rpx;
					margin-right: 20rpx;
				}
			}

			.coupons {
				width: 100%;
				min-height: 100%;
				background-color: #EDF5F5;
				padding-bottom: env(safe-area-inset-bottom);
				position: relative;
				margin-bottom: 100rpx;

				.scrolllist {
					position: fixed;
					z-index: 999;
					color: #000000;
					width: 80%;
					height: 50%;
					background-color: #fff;
					left: 10%;
					top: 20%;
					border-radius: 10rpx;

					.fanhui {
						width: 30%;
						height: 80rpx;
						background: linear-gradient(0deg, #4BA677, #4BA677);
						border-radius: 40rpx;
						text-align: center;
						line-height: 80rpx;
						color: #fff;
						margin: 0 auto;
						font-size: 30rpx;
						margin-top: 10rpx;
						position: absolute;
						bottom: 20rpx;
						left: 35%;
					}

					.toubu {
						width: 100%;
						height: 50rpx;
						font-size: 32rpx;
						font-weight: 600;
						color: #333333;
						text-align: center;
						margin-top: 10rpx;
						position: absolute;
						top: 10rpx;
					}

					.scroll {
						position: absolute;
						z-index: 999;
						color: #000000;
						width: 100%;
						height: 36vh;
						background-color: #fff;
						left: 0;
						top: 70rpx;
						border-radius: 10rpx;

						.lingqu {
							color: rgba(224, 37, 27, 1);
							font-size: 28rpx;
							text-align: left;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
							width: 100%;
							height: 40rpx;
							line-height: 40rpx;
							margin-left: 20rpx;
							margin-top: 20rpx;
						}

						.xiangqing {
							width: 97%;
							height: auto;
							overflow-wrap: break-word;
							color: rgba(0, 0, 0, 1.0);
							font-size: 28rpx;
							font-weight: 500;
							text-align: left;
							line-height: 34rpx;
							margin: 10rpx 0 0 20rpx;
							padding-right: 20rpx;
						}
					}
				}

				/deep/.u-tabs {
					background-color: #fff;

					.u-tabs__wrapper__nav__item {
						flex: 1;
					}
				}

				.coupons-list {
					padding: 20rpx 10rpx;

					&.lapse {
						.left {
							color: #bebebe;
						}
					}
				}

				.coupons-item {
					background-color: #fff;
					border-radius: 16rpx;
					padding: 40rpx 0;
					position: relative;
					overflow: hidden;

					&::before,
					&::after {
						content: '';
						position: absolute;
						top: 50%;
						background-color: #EDF5F5;
						width: 40rpx;
						height: 40rpx;
						border-radius: 50%;
						transform: translateY(-50%);
					}

					&::before {
						left: 0;
						transform: translate(-50%, -50%);
					}

					&::after {
						right: 0;
						transform: translate(50%, -50%);
					}

					&+.coupons-item {
						margin-top: 20rpx;
					}

					.status {
						top: -30rpx;
						right: 30rpx;
						width: 116rpx;
						height: 116rpx;
						background-position: left top;
						background-repeat: no-repeat;
						background-size: 100% 100%;
					}

					.left {
						width: 240rpx;
						color: #56BF89;
						font-size: 28rpx;

						.free {
							font-size: 42rpx;
						}

						.price {
							font-size: 46rpx;
							font-weight: bold;
						}
					}

					.button_1 {
						background-color: rgba(255, 255, 255, 1);
						border-radius: 30px;
						height: 60rpx;
						border: 1px solid #56BF89;
						width: 174rpx;
						position: absolute;
						bottom: 10rpx;
						right: 10rpx;
						text-align: center;
						line-height: 60rpx;

						.text_11 {
							width: 111rpx;
							height: 60rpx;
							overflow-wrap: break-word;
							color: #56BF89;
							font-size: 28rpx;
							font-family: PingFang-SC-Medium;
							font-weight: 500;
							text-align: left;
							white-space: nowrap;
							line-height: 60rpx;
							// margin: 17rpx 0 0 30rpx;
						}
					}

					.right {
						flex: 1;

						.name {
							color: #000;
							font-size: 32rpx;
							font-weight: bold;
						}

						.desc {
							font-size: 28rpx;
							color: #d1d1d1;
							margin-top: 10rpx;
						}

						.ada {
							width: 62px;
							height: 26px;
							background: linear-gradient(270deg, #47B37B 0%, #69D19B 100%), #4BA677;
							border-radius: 7px;
							font-size: 12px;
							color: #FFFFFF;
							line-height: 26px;
							text-align: center;
							margin-top: 20rpx;
							margin-right: 20rpx;
						}
					}
				}
			}
		}

		.tabs_1 {
			width: 100%;
			height: 100rpx;
			padding: 0 20rpx;
			// position: fixed;
			// z-index: 999;
			// top: 390rpx;
			background-color: #fff;

			/deep/.u-tabs {
				// background-color: #fff;

				.u-tabs__wrapper__nav__item {
					flex: 1;
				}

				.u-tabs__wrapper__nav__line {
					bottom: 0;
				}
			}
		}
	}
</style>